package exception;

public class ThrowDemo {
    public static void main(String[] args) {
        Person p = new Person();
//        try {
//            p.setAge(181);
//        } catch (Exception e) {
//            System.out.println("年龄不合法");
//        }
        try {
            p.setAge(100);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("此人年龄"+p.getAge()+"岁");
    }
}
